/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

import java.util.Timer;
import java.util.TimerTask;
import javax.microedition.lcdui.game.Sprite;

/**
 *
 * @author Monster
 */
public class Boss extends QuaiVat {

    public Boss(Sprite s, int x, int y) {
        super(s, x, y);
        this._sprite.defineCollisionRectangle(3, 3, 54, 54);
        this._sprite.setPosition(x, y);
    }

    public void SetVitri(int x, int y) {
        this._sprite.setPosition(x, y);
    }

    public void NamNghi() {
        Timer timer = new Timer();
        this.moving = true;
        TimerTask timertask = new TimerTask() {

            public void run() {
                if (moving) {
                    _sprite.nextFrame();
                }
            }
        };
        timer.scheduleAtFixedRate(timertask, 0, 200);
    }

    public void HoatDong() {
        GameDesign_1 design = new GameDesign_1();
        movement = new SpriteRandomMovement(_sprite);
        movement.setSpeed(4);
        movement.ThemVatCanDong(VatCanDong, iVatCanDong);
        movement.ThemDoiTuongGayHai(DoiTuongGayHai, this.iDoiTuongGayHai);
        movement.ThemVatCanTinh(VatCanBinhThuong, this.iVatCanBinhThuong);
        movement.setSequences(design.walk,design.walk,design.walk,design.walk);
        (new Thread(movement)).start();
    }
}
